package com.java.hibernate.dao.impl;

import com.java.hibernate.dao.UserDao;
import com.java.hibernate.entity.User;
import org.springframework.stereotype.Repository;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;

/**
 * @Author: Dgg
 * @Date: 2022/4/22 21:42
 */

@Repository
public class UserDaoImpl implements UserDao {
	@PersistenceContext
	private EntityManager entityManager;

	@Override
	public List<User> getAllBooks() {
		return null;
	}

	@Override
	public User getBookById(int bookId) {
		return entityManager.find(User.class, bookId);
	}

	@Override
	public void addBook(User book) {

	}

	@Override
	public void updateBook(User book) {

	}

	@Override
	public void deleteBook(int bookId) {

	}

	@Override
	public boolean bookExists(String title, String category) {
		return false;
	}
}
